{include file="../../../application/admin/view/public/head" /}
<div class="page-container p10">
    <div class="my-toolbar-box">

        <div class="layui-btn-group">
            <a data-href="{php}echo $GLOBALS['config']['site']['install_dir'];{/php}api.php/Lywqautotrigger/info" class="layui-btn layui-btn-primary j-iframe"><i class="layui-icon">&#xe654;</i>添加</a>
            <a data-href="{php}echo $GLOBALS['config']['site']['install_dir'];{/php}api.php/Lywqautotrigger/del" class="layui-btn layui-btn-primary j-ajax" confirm="确认清空数据吗？操作不可恢复"><i class="layui-icon">&#xe640;</i>清空</a>
            <a href="" class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe620;</i>刷新</a>
        </div>

    </div>

    <form class="layui-form " method="post" id="pageListForm">
        <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <th width="30">编号</th>
                <th width="80">名称</th>
                <th width="150">描述</th>
                <th width="150">访问链接</th>
                <th width="80">访问间隔</th>
                <th width="80">运行时间</th>
                <th width="80">状态</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            {volist name="list" id="vo"}
            <tr>
                <td>{$vo.id}</td>
                <td>{$vo.name}</td>
                <td>{$vo.describe}</td>
                <td>{$vo.url}</td>
                <td>{$vo.interval}小时</td>
                <td>{$vo.runtime}</td>
                <td>
                    <input type="checkbox" name="status" {if condition="$vo['status'] eq 1"}checked{/if} value="{$vo['status']}" lay-skin="switch" lay-filter="switchStatus" lay-text="正常|关闭" data-href="{:url('field?col=status&ids='.$vo['id'])}">
                </td>
                <td>
                    <a class="layui-badge-rim" target="_blank" href="{php}echo $GLOBALS['config']['site']['install_dir'];{/php}api.php/Lywqautotrigger/execute?mode=test&id={$vo['id']}" title="测试">测试</a>
                    <a class="layui-badge-rim j-iframe" data-href="{php}echo $GLOBALS['config']['site']['install_dir'];{/php}api.php/Lywqautotrigger/info?id={$vo['id']}" href="javascript:;" title="编辑">编辑</a>
                    <a class="layui-badge-rim j-tr-del" data-href="{php}echo $GLOBALS['config']['site']['install_dir'];{/php}api.php/Lywqautotrigger/del?id={$vo['id']}" href="javascript:;" title="删除">删除</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div id="page" class="center"></div>
    </form>
</div>

{include file="../../../application/admin/view/public/foot" /}

<script type="text/javascript">
    layui.use(['laypage', 'layer'], function() {
        var laypage = layui.laypage
                , layer = layui.layer;
        laypage.render({
            elem: 'page'
            ,count: {if condition="$count eq ''"}0{else}{$count}{/if}
            ,limit: {if condition="$limit eq ''"}6{else}{$limit}{/if}
            ,curr: {if condition="$page eq ''"}0{else}{$page}{/if}
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj,first){
                if(!first){
                    location.href = 'index?page='+obj.curr+'&limit='+obj.limit;
                }
            }
        });
    });
</script>
</body>
</html>